package(default_visibility = ["//visibility:public"])

load(
    "@io_bazel_rules_go//go:def.bzl",
    "go_library",
    "go_test",
)

go_test(
    name = "go_default_test",
    srcs = [
        "branch_protection_test.go",
        "config_test.go",
        "inrepoconfig_test.go",
        "jobs_test.go",
        "tide_test.go",
    ],
    data = [
        ":fixtures",
        ":package-srcs",
        "//config:prowjobs",
        "//config/prow:configs",
        "//prow/apis/prowjobs/v1:all-srcs",
    ],
    embed = [":go_default_library"],
    deps = [
        "//pkg/genyaml:go_default_library",
        "//prow/apis/prowjobs/v1:go_default_library",
        "//prow/config/secret:go_default_library",
        "//prow/gerrit/client:go_default_library",
        "//prow/git/localgit:go_default_library",
        "//prow/git/v2:go_default_library",
        "//prow/github:go_default_library",
        "//prow/github/fakegithub:go_default_library",
        "//prow/kube:go_default_library",
        "//prow/labels:go_default_library",
        "//prow/pod-utils/decorate:go_default_library",
        "//prow/pod-utils/downwardapi:go_default_library",
        "@com_github_google_go_cmp//cmp:go_default_library",
        "@com_github_google_go_cmp//cmp/cmpopts:go_default_library",
        "@com_github_tektoncd_pipeline//pkg/apis/pipeline/v1alpha1:go_default_library",
        "@io_k8s_api//core/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/util/diff:go_default_library",
        "@io_k8s_apimachinery//pkg/util/errors:go_default_library",
        "@io_k8s_apimachinery//pkg/util/sets:go_default_library",
        "@io_k8s_utils//pointer:go_default_library",
    ],
)

go_library(
    name = "go_default_library",
    srcs = [
        "agent.go",
        "branch_protection.go",
        "config.go",
        "inrepoconfig.go",
        "jobs.go",
        "tide.go",
    ],
    importpath = "k8s.io/test-infra/prow/config",
    deps = [
        "//prow/apis/prowjobs/v1:go_default_library",
        "//prow/gerrit/client:go_default_library",
        "//prow/git/v2:go_default_library",
        "//prow/github:go_default_library",
        "//prow/interrupts:go_default_library",
        "//prow/kube:go_default_library",
        "//prow/logrusutil:go_default_library",
        "//prow/pod-utils/decorate:go_default_library",
        "//prow/pod-utils/downwardapi:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@com_github_tektoncd_pipeline//pkg/apis/pipeline/v1alpha1:go_default_library",
        "@in_gopkg_fsnotify_v1//:go_default_library",
        "@in_gopkg_robfig_cron_v2//:go_default_library",
        "@io_k8s_api//core/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/labels:go_default_library",
        "@io_k8s_apimachinery//pkg/util/errors:go_default_library",
        "@io_k8s_apimachinery//pkg/util/sets:go_default_library",
        "@io_k8s_apimachinery//pkg/util/validation:go_default_library",
        "@io_k8s_sigs_yaml//:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//prow/config/jobtests:all-srcs",
        "//prow/config/org:all-srcs",
        "//prow/config/secret:all-srcs",
    ],
    tags = ["automanaged"],
)

filegroup(
    name = "fixtures",
    srcs = glob(["*.yaml"]),
    visibility = ["//visibility:private"],
)
